package com.vogue.supplymall.shop.domain.service;

import com.vogue.supplymall.common.domain.dto.QueryListResultInfo;
import com.vogue.supplymall.common.domain.dto.SearchInfo;
import com.vogue.supplymall.common.domain.dto.UserInfo;
import com.vogue.supplymall.shop.domain.model.Product;

import java.util.List;
import java.util.Map;

/**
 * The interface Product service.
 *
 * @Aouthor: zhangliang
 * @Date: Create in 2017-12-05
 */
public interface ProductService extends BaseService<Product, Long> {

    /**
     * Find by id product.
     * 按id检索商品
     *
     * @param id the id
     * @return the product
     */
    Product findById(Long id);

    /**
     * Find product by id list.
     * 商品详情检索
     *
     * @param id   the id
     * @param info the info
     * @return the list
     */
    List<Map<String, Object>> findProductById(Long id, UserInfo info);

    /**
     * Find by name list.
     * 按输入框内容检索商品
     *
     * @param searchInfo the search info
     * @return the list
     */
    List<Map<String, Object>> findBySearchInfo(SearchInfo searchInfo);

    /**
     * 按输入框内容检索商品 （返回带总记录数的结果集合）
     * @param searchInfo
     * @return
     */
    QueryListResultInfo findListBySearchInfo(SearchInfo searchInfo);

    /**
     * Find product unit list.
     * 根据条件检索商品详情的单位
     *
     * @param searchInfo the search info
     * @return the list
     */
    List<Map<String, Object>> findProductUnit(SearchInfo searchInfo);

    /**
     * 根据sysCodeId,shopId和matchId找到对应的商品
     *
     * @param sysCodeId the sys code id
     * @param shopId    the shop id
     * @param matchIds   the match id
     * @return the list
     */
    public List<Product> findProductBySSM(Long sysCodeId,Long shopId,List<String> matchIds);

    /**
     * 根据syscodeid和productids找到不禁用的商品id
     *
     * @param sysCodeId  the sys code id
     * @param productIds the product ids
     * @return the product id by sp
     */
    public List<Map<String, Object>> getProductIdBySp(Long sysCodeId,String productIds);

    /**
     * 根据syscodeid和productids更改商品的禁用标记
     *
     * @param sysCodeId    the sys code id
     * @param productIds   the product ids
     * @param disabledFlag the disabled flag
     * @return the int
     */
    public int changeProductDisabledFlag(Long sysCodeId,String productIds,boolean disabledFlag);

    /**
     * 根据syscodeid和shopId找到该店铺下的所有商品
     *
     * @param sysCodeId the sys code id
     * @param shopId    the shop id
     * @return the list
     */
    public List<Product> findProductBySS(Long sysCodeId,Long shopId);

    /**
     * 根据syscodeid和productids得到商品的默认单位数量和商品的id
     *
     * @param sysCodeId  the sys code id
     * @param productIds the product ids
     * @return the list
     */
    public List<Map<String, Object>> findProductDUCBySP(Long sysCodeId,String productIds);

    /**
     * 根据syscodeid和productids更改商品的默认单位为最先上传的单位
     *
     * @param sysCodeId  the sys code id
     * @param productIds the product ids
     */
    public void changeNoUnitProductDU(Long sysCodeId,String productId);

    /**
     * 根据syscodeid和productids更改商品的默认单位为最新修改上传的单位
     *
     * @param sysCodeId  the sys code id
     * @param productIds the product ids
     */
    public void changeManyUnitProductDU(Long sysCodeId,String productId);

    /**
     * 用insert语句存储商品与客户的对应关系
     *
     * @param values the values
     */
  //  public void saveProductCustomerRelation(String values);

    /**
     * 根据卖家注册号id删除商品与客户的对应关系
     *
     * @param sellsyscodeid the sellsyscodeid
     */
    public void delProductCustomerRelation(Long sellsyscodeid);
    /**
     * 根据syscodeId和shopId找到所有的商品和商品对应的单位
     */
    public List<Map<String, Object>> getProductInfoBySS(Long syscodeId,Long shopId);
}
